package org.stvd.entities.workflow;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.springframework.format.annotation.DateTimeFormat;
import org.stvd.core.util.DateUtil;

/**
 * @Title WfIndex
 * @Destribution 流程索引入口
 * @author houzx
 * @date 2020年10月29日
 */
@Entity
@Table(name = "WF_INDEX")
public class WfIndex implements Serializable{

    private static final long serialVersionUID = 6721863190882668753L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "customer_gen")
    @TableGenerator(name = "customer_gen", table = "KEYTABLE", pkColumnName = "keyname", valueColumnName = "keyvalue", pkColumnValue = "WfIndex_PK", allocationSize = 1)
    @Column(name = "ID")
    private Long id = null;
    
    @Column(name = "PROC_INST_ID")
    private String procInstId = "";
    
    @Column(name = "PROC_DEF_ID")
    private String procDefId = "";
    
    @Column(name = "PROC_DEF_KEY")
    private String procDefKey = "";
    
    @Column(name = "CANDIDATE")
    private String candidate = "";
    
    @Column(name = "GROUP_ID")
    private String groupId = "";
    
    @Column(name = "ASSIGNEE")
    private String assignee = "";
    
    @Column(name = "START_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime = null;
    
    @Column(name = "END_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime = null;
    
    @Column(name = "USER_ID")
    private String userId = "";
    
    @Column(name = "DEP_ID")
    private String depId = "";
    
    @Column(name = "HIST_USERS")
    private String histUsers = "";
    
    @Column(name = "TASK_NAME")
    private String taskName = "";
    
    @Column(name = "TASK_ID")
    private String taskId = "";
    
    @Column(name = "STATUS")
    private String status = "";
    
    public WfIndex(){}
    
    public WfIndex(String procDefKey, String userId, String depId){
        this.procDefKey = procDefKey;
        this.userId = userId;
        this.depId = depId;
        this.startTime = DateUtil.getSystemDate();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getProcInstId() {
        return procInstId;
    }

    public void setProcInstId(String procInstId) {
        this.procInstId = procInstId;
    }

    public String getProcDefId() {
        return procDefId;
    }

    public void setProcDefId(String procDefId) {
        this.procDefId = procDefId;
    }

    public String getProcDefKey() {
        return procDefKey;
    }

    public void setProcDefKey(String procDefKey) {
        this.procDefKey = procDefKey;
    }

    public String getCandidate() {
        return candidate;
    }

    public void setCandidate(String candidate) {
        this.candidate = candidate;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getAssignee() {
        return assignee;
    }

    public void setAssignee(String assignee) {
        this.assignee = assignee;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getDepId() {
        return depId;
    }

    public void setDepId(String depId) {
        this.depId = depId;
    }

    public String getHistUsers() {
        return histUsers;
    }

    public void setHistUsers(String histUsers) {
        this.histUsers = histUsers;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
